package cn.wh.ymcc.feignclients;

import cn.wh.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CommonFeignClientFallbackFactory implements FallbackFactory<CommonFeignClient> {
    @Override
    public CommonFeignClient create(Throwable throwable) {
        return new CommonFeignClient() {
            @Override
            public JSONResult messagePush(String courseName) {
                throwable.printStackTrace();
                return JSONResult.error("认证服务不可达");
            }
        };
    }
}
